object frmModule: TfrmModule
  Left = 367
  Top = 218
  Width = 805
  Height = 443
  Caption = #36830#25509#26381#21153#22120
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object conKis: TADOConnection
    CommandTimeout = 60
    ConnectionTimeout = 60
    ConnectOptions = coAsyncConnect
    CursorLocation = clUseServer
    LoginPrompt = False
    Provider = 'SQLOLEDB.1'
    Left = 16
    Top = 8
  end
  object dsBomGroup: TDataSource
    Left = 88
    Top = 8
  end
  object qryShowBomBill: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 160
    Top = 8
  end
  object dsShowBomBill: TDataSource
    DataSet = qryShowBomBill
    Left = 192
    Top = 8
  end
  object qryKisBomGroup: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 48
    Top = 8
  end
  object qryMainItem: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 264
    Top = 8
  end
  object dsMainItem: TDataSource
    DataSet = qryMainItem
    Left = 296
    Top = 8
  end
  object qryBomList: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 360
    Top = 8
  end
  object dsBomList: TDataSource
    DataSet = qryBomList
    Left = 400
    Top = 8
  end
  object qryBomListAll: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 456
    Top = 8
  end
  object dsBomListAll: TDataSource
    DataSet = qryBomListAll
    Left = 488
    Top = 8
  end
  object qrySfp: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 544
    Top = 8
  end
  object dsSfp: TDataSource
    DataSet = qrySfp
    Left = 576
    Top = 8
  end
  object qryBomPrice: TADOQuery
    Connection = conKis
    Parameters = <>
    SQL.Strings = (
      '')
    Left = 16
    Top = 56
  end
  object dsBomPrice: TDataSource
    DataSet = qryBomPrice
    Left = 48
    Top = 56
  end
  object qryBomLevelList: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 96
    Top = 56
  end
  object dsBomLevelList: TDataSource
    DataSet = qryBomLevelList
    Left = 128
    Top = 56
  end
  object qryGetMM: TADOQuery
    Connection = conKis
    Parameters = <>
    Left = 192
    Top = 56
  end
  object dsGetMM: TDataSource
    DataSet = qryGetMM
    Left = 224
    Top = 56
  end
  object mtblhLibExist: TMemTableEh
    AggregatesActive = True
    DetailFields = 'fitemid'
    MasterFields = 'fitemid'
    MasterSource = dsBomLevelList
    Params = <>
    DataDriver = adtdrvrhLibExist
    ReadOnly = True
    Left = 656
    Top = 16
  end
  object qryGetF: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 304
    Top = 56
  end
  object dsGetF: TDataSource
    DataSet = qryGetF
    Left = 336
    Top = 56
  end
  object qrySearch: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 520
    Top = 56
  end
  object dsLibExist: TDataSource
    DataSet = mtblhLibExist
    Left = 720
    Top = 16
  end
  object adtdrvrhLibExist: TADODataDriverEh
    ADOConnection = conKis
    SelectCommand.CommandText.Strings = (
      'Set Nocount on'
      'Create Table #TempInventory( '
      '                            [FItemID] [int] NOT NULL ,'
      
        '                            [FBatchNo] [varchar] (200)  NOT NULL' +
        ' ,'
      '                            [FStockID] [int] NOT NULL ,'
      '                            [FQty] [decimal](28, 10) NOT NULL ,'
      
        '                            [FKFPeriod] [int] NOT NULL Default(0' +
        '),'
      
        '                            [FKFDate] [varchar] (255)  NOT NULL ' +
        ','
      '                            [FAuxPropID] [int] NOT NULL,'
      '                            [FSumSort] [int] NULL '
      '                             )'
      
        ' Insert Into #TempInventory Select u1.FItemID,u1.FBatchNo,u1.FSt' +
        'ockID,u1.FQty,'
      
        ' u1.FKFPeriod,ISNULL(u1.FKFDate,'#39#39'),u1.FAuxPropID,0 From ICInven' +
        'tory u1'
      ' left join t_Stock t2 on u1.FStockID=t2.FItemID'
      ' left join t_ICItem t1 on u1.FItemID = t1.FItemID'
      ' left join t_MeasureUnit t3 on t1.FUnitID=t3.FMeasureUnitID'
      ' left join t_MeasureUnit t4 on t1.FStoreUnitID=t4.FMeasureUnitID'
      ''
      ' Where 1=1  And t1.FDeleted=0'
      ''
      ' And u1.FQty<>0 '
      
        'Select t1.FItemID as FItemID,t1.FName as FMaterialName,ISNull(t1' +
        '.FModel,'#39' '#39') as FMaterialModel,t1.FNumber AS FMaterialNumber,ISN' +
        'ull(t1.FNote,'#39' '#39') as FNote, '
      
        ' t3.FName as FBUUnitName,t4.FName as FCUUnitName,t1.FQtyDecimal,' +
        ' t1.FPriceDecimal, '
      
        ' '#39' '#39' FKFPeriod,'#39' '#39' FKFDate,'#39' '#39' FMaturityDate,  '#39' '#39' as FBatchNo,'#39 +
        ' '#39' AS FStockNumber,'#39' '#39' as FStockName,0 as FStockTypeID,t9.FName ' +
        'as FAuxPropName,'
      ' Sum(u1.FQty) as FBUQty,Sum(u1.FQty/t4.FCoefficient) as FCUUQty '
      ' '
      ' Into #ReturnInventory From #TempInventory u1 '
      ' left join t_Stock t2 on u1.FStockID=t2.FItemID'
      ' left join t_AuxItem t9 on u1.FAuxPropID=t9.FItemID  '
      ' left join t_ICItem t1 on u1.FItemID = t1.FItemID'
      ' left join t_MeasureUnit t3 on t1.FUnitID=t3.FMeasureUnitID'
      ' left join t_MeasureUnit t4 on t1.FStoreUnitID=t4.FMeasureUnitID'
      ''
      ' Where 1=1  And t1.FDeleted=0'
      
        '  Group By t1.FItemID,t1.FName,t1.FModel,t1.FNumber,t1.FNote,t3.' +
        'FName,t4.FName,t1.FQtyDecimal,t1.FPriceDecimal,t9.FName  '
      ' Delete From #ReturnInventory Where FBUQty=0 '
      
        ' Select fitemid,FMaterialNumber as "'#29289#26009#20195#30721'",FMaterialName as "'#29289#26009#21517#31216 +
        '",FMaterialModel as "'#35268#26684#22411#21495'",FCUUQty as "'#24211#23384#25968#37327'",  '
      
        '        FCUUnitName as "'#21333#20301'",FAuxPropName as "'#36741#21161#23646#24615'",FBatchNo as "' +
        #25209#21495'",FNote as "'#22791#27880'"'
      'From #ReturnInventory  Order By FMaterialNumber,FAuxPropName '
      'Drop Table #TempInventory '
      'Drop Table #ReturnInventory')
    SelectCommand.Parameters = <>
    UpdateCommand.Parameters = <>
    InsertCommand.Parameters = <>
    DeleteCommand.Parameters = <>
    GetrecCommand.Parameters = <>
    DynaSQLParams.Options = []
    Left = 688
    Top = 16
  end
  object dsF: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 720
    Top = 56
  end
  object qryGetAuxF: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 712
    Top = 120
  end
  object qryBomListLibExist: TADOQuery
    Connection = conKis
    LockType = ltReadOnly
    Parameters = <>
    Left = 48
    Top = 160
  end
  object dsBomListLibExist: TDataSource
    DataSet = qryBomListLibExist
    Left = 88
    Top = 160
  end
end
